package com.hna.eking.AirlineServer.Mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;

public interface AreaMapInfoMapper {
	@Select("SELECT * FROM T_Area_Info where effect_flag = '0001' ")
	public List<AreaMapInfo> selectAllEfft();

	@Select("SELECT * FROM T_Area_Info where effect_flag = '0001' and map_code = #{0}")
	public AreaMapInfo selectByCode(String mapCode);
	
	@SelectProvider(type = SqlUtils.class, method = "AreaMapByInput")
	public List<AreaMapInfo> selectAllByInput(String mapCode, String mapName, int limit, int offset);
	@SelectProvider(type = SqlUtils.class, method = "AreaMapCountByInput")
	public int selectCountByInput(String mapCode, String mapName);

	@Update("update T_Area_Info set effect_flag = '0000', update_user = #{1},update_date = #{2}"
			+ " where map_code = #{0}")
	public void DelAreaInfo(String mapCode, String user, java.util.Date dt);

	@Update("update T_Area_Info 	 set map_name=#{mapName},"
			+ "file_path=#{filePath},update_date=#{updateDate},update_user=#{updateUser}"
			+ "where map_code=#{mapCode}")
	public void UptAreaInfo(AreaMapInfo areainfo);
	
	@Insert("INSERT INTO T_Area_Info(map_code,map_name,file_path,"
			+ "create_date,create_user,update_date,update_user,effect_flag)"
			+ "VALUES(#{mapCode},#{mapName},#{filePath},#{createDate},#{createUser},#{updateDate},"
			+ "#{updateUser},#{effectFlag})")
	public void InsertAreaInfo(AreaMapInfo areainfo);
}
